﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

using System.Runtime.InteropServices;

namespace DrawingTest
{
    public partial class FormPicture : Form
    {
        private SizeF windowssize = new SizeF(841, 570);

        // input point list
        PointF[] m_pointlist;

        public FormPicture(PointF[] pointlist)
        {
            InitializeComponent();
            m_pointlist = pointlist;
        }

        protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);
            Graphics dc = e.Graphics;
            PointF[] pointArray = {
                                     new Point(0,0),
                                     new Point(0,1),
                                     new Point(2,2),
                                     new Point(3,3),
                                     new Point(5,5),
                                     new Point(0,0)
                                 };
            Drawtest1 pic = new Drawtest1(dc, m_pointlist.ToArray(), windowssize);

            try
            {
            	pic.draw();
            }
            catch (System.Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
    }
}
